import request from '@/utils/request'

// 获取题库列表
export function getRepolist(params) {
  return request({
    url: '/api/repo/list',
    method: 'get',
    params
  })
}

// 获取题库信息
export function getRepoInfo(params) {
  return request({
    url: '/api/repo/paging',
    method: 'get',
    params
  })
}

/**
 * 添加题库
 * @param {
 * "id": 0,
 * "userId": 0,
 * "title": "string",
 * "createTime": "string",
 * "isDeleted": 0
 * } data 
 * @returns 
 * {
 * "code": 0,
 * "data": "",
 * "msg": ""
 * }
 */
export function addrepo(data) {
  return request({
    url: '/api/repo',
    method: 'post',
    data,
  })
}


// 删除题库 单个
export function deleteRepo(id) {
  return request({
    url: `/api/repo/${id}`,
    method: 'delete',
  })
}

// 编辑题库
export function editRepo(data) {
  return request({
    url: `/api/repo`,
    method: 'put',
    data,
  })
}
